<script setup>
	import {
		ref,
		defineEmits,
		defineProps
	} from 'vue'
	import UploadDescriptionAttachment from '@/components/audit/function/UploadDescriptionAttachment.vue'
	import config from '@/config.js'

	const designDrawings = ref([])
	const emit = defineEmits(['getDesignDrawingsEmit'])
	const props = defineProps({
		fileTitle: String,
		fileSubtitle: String,
		isrequired:Boolean
	})
	// 获取上传的图片
	const getSuccessUrl = (fileName) => {
		designDrawings.value.push(config.baseUrl + fileName)
		emit('getDesignDrawingsEmit', designDrawings.value)
	}
	// 删除图片后的数据
	const onDelete = (v) => {
		designDrawings.value = v
		emit('getDesignDrawingsEmit', designDrawings.value)
	}
</script>

<template>
	<view class="container">
		<UploadDescriptionAttachment @getSuccessUrl="getSuccessUrl" @onDelete="onDelete" :isrequired="props.isrequired" :fileTitle="props.fileTitle" :fileSubtitle="props.fileSubtitle" />
	</view>
</template>

<style lang="scss" scoped>
	.container {
		margin-top: 20rpx;
	}
</style>